package com.dimples.dd.common.enums;

import lombok.Getter;

/**
 * @author zhongyj <1126834403@qq.com><br/>
 * @date 2024/10/9
 */
@Getter
public enum WeekEnum {
    SUNDAY("1", "星期天", "Sunday "),
    MONDAY("2", "星期一", "Monday "), TUESDAY("3", "星期二", "Tuesday "),
    WEDNESDAY("4", "星期三", "Wednesday "), THURSDAY("5", "星期四", "Thursday "),
    FRIDAY("6", "星期五", "Friday "), SATURDAY("7", "星期六", "Saturday ");

    private final String key;

    private final String nameCn;

    private final String nameEn;

    WeekEnum(String key, String nameCn, String nameEn) {
        this.key = key;
        this.nameCn = nameCn;
        this.nameEn = nameEn;
    }

    public static String matchNameCn(String code) {
        for (WeekEnum m : WeekEnum.values()) {
            if (m.getKey().equals(code)) {
                return m.getNameCn();
            }
        }
        return "";
    }

    public static String matchNameEn(String code) {
        for (WeekEnum m : WeekEnum.values()) {
            if (m.getKey().equals(code)) {
                return m.getNameEn();
            }
        }
        return "";
    }

}
